<template>
  <el-drawer v-model="drawerVisible" :destroy-on-close="true" size="1000px" title="上传签署文件">
    <div class="import-wrap">
      <el-upload
        class="upload-wrap mt-20"
        drag
        action="https://run.mocky.io/v3/9d059bf9-4660-45f2-925d-ce80ad6c4d15"
        :multiple="false"
        :limit="1"
      >
        <el-icon class="el-icon--upload"><upload-filled /></el-icon>
        <div class="el-upload__text font-12 text-grey">
          将文件拖拽至此或 <em>点击上传</em>
          <br />
          请上传，10M以内doc或PDF的格式文件，最多只能上传 1 份文件
        </div>
      </el-upload>
    </div>
    <template #footer>
      <el-button @click="drawerVisible = false">取消</el-button>
      <el-button type="primary" @click="handleSubmit">确定</el-button>
    </template>
  </el-drawer>
</template>

<script setup lang="ts" name="UserDrawer">
import { ref } from "vue";

interface DrawerProps {
  getTableList?: () => void;
}

const drawerVisible = ref(false);
const drawerProps = ref<DrawerProps>({});

// 接收父组件传过来的参数
const acceptParams = (params: DrawerProps) => {
  drawerProps.value = params;
  drawerVisible.value = true;
};
const handleSubmit = () => {
  //   drawerProps.value.search!();
  //   drawerVisible.value = false;
};

defineExpose({
  acceptParams
});
</script>

<style lang="scss" scoped>
.upload-wrap {
  height: 384px;

  :deep(.el-upload),
  :deep(.el-upload-dragger) {
    height: 100%;
  }
}
</style>
